[Unit]
Description=mongodb
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
ExecStart=/usr/local/mongodb/bin/mongod -f {{ hostvars[ansible_default_ipv4.address].install_path }}/mongodb.conf
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/usr/local/mongodb/bin/mongod -f {{ hostvars[ansible_default_ipv4.address].install_path }}/mongodb.conf --shutdown
PrivateTmp=true
[Install]
WantedBy=multi-user.target